/*
 var file;
try{
   // file = _$file_path$_;
    throw new Error('_locate_');
}catch(e){
	console.log
   file = findErrorFile(e);
//	if (!file) {
        var scripts = document.scripts,
            lastScript = scripts[scripts.length - 1],
            src = lastScript.getAttribute('src');
    // !lastScript.async && !lastScript.defer
    /*
        console.log(src);
        for(var i in lastScript) {
            console.log('p:'+ i + "=" + lastScript[i]);
        }
		console.log('document.body', document.body, script = document.scripts)
		var c = (document.body || document.head).childNodes;
		var script = c[c.length - 1];
		if ('SCRIPT' === script.nodeName && script.defer === false) {
			console.log('ie8  ', script.src);
		}
//	}
}

//
function findErrorFile(e) {
	console.log(e.name);
	console.log(e.message);
	console.log(e.description);
    var file;
    if(e.fileName){  //firefox
        console.log('fileName', e.fileName);
        file = e.fileName;
    }else if(e.sourceURL){ //safari
        console.log('sourceURL', e.sourceURL);
        file =  e.sourceURL;
    }else if(e.stacktrace){//opera
        console.log(e.stacktrace)
        // var m = e.stacktrace.match(/(/) in/s+(.*?/://///S+)/m);
        if (m && m[1])
            file =  m[1]
    } else if (e.stack) {   // ff, format is ... @file:line:col chrome format is ... at file:line:col
        file = e.stack.match('(?:http|https).*(?=:[0-9]+:[0-9]+)')[0];
    }
    return file;
}
*/
//console.log('file', file);
(function() {
    var observer = new MutationObserver(function(mutations) {
        mutations.forEach(function(mutation) {
            // console.log(mutation);
            if ('childList' == mutation.type && 0 < mutation.addedNodes.length) {
                var regex = new RegExp('(?:^| )' + 'js-goto-top' + '(?: |$)');
                if (regex.test(mutation.addedNodes[0].className)) {
                    console.log(mutation.addedNodes[0]);
                }
            }
            if ('attributes' == mutation.type) {
            }
        });
    });

    observer.observe(document, {
        childList: true,
        subtree: true,
        attributes: true,
        attributeFilter: ['class']
    });
    console.log('over');
})();
